package com.guyu.common.core.exception.code;

import lombok.AllArgsConstructor;
import lombok.Getter;


/**
 * <p> 公共错误码 </p>
 */
@Getter
@AllArgsConstructor
public enum ErrorCodeEnum {
    OK(0, "接口调用成功"),

    BAD_REQUEST(1000, "错误的请求"),
    UNKNOWN_ERROR(1001, "服务器内部异常"),
    SERVER_UNAVAILABLE(1002, "服务不可用"),
    CALL_LIMITED(1003, "调用频次超限"),
    REQUEST_TIMEOUT(1004, "请求超时"),
    NOT_FOUND(1005, "资源不存在或已被删除"),
    METHOD_NOT_ALLOWED(1006, "方法不被允许"),
    UNSUPPORTED_MEDIA_TYPE(1007, "不支持的媒体类型"),
    MISSING_PARAMS(1008, "缺少必选参数"),
    ILLEGAL_ARGUMENT(1009, "非法的参数"),

    UNAUTHORIZED(2000, "权限不足"),
    FORBIDDEN(2001, "禁止访问"),
    RELOGIN(2002, "登录已失效，请您重新登录"),
    NOT_PERMISSION(2003, "用户无对应权限，禁止访问"),
    NOT_ROLE(2004, "用户无对应角色，禁止访问"),

    MAIL_ERROR(5000, "邮件异常"),
    OSS_ERROR(5001, "文件存储异常"),
    PASSWORD_ERROR(5002, "密码错误"),
    EXCEL_ERROR(5003, "表格异常"),

    BUSINESS_FAILURE(10000, "业务处理失败"),
    //
    ;

    private final int code;
    private final String message;
}
